import 'package:myturngame/bean/function/suit_function.dart';
import 'package:myturngame/common/game_global.dart';

import '../passive_effect.dart';

class Suit {
  String name;
  int invokeCount;
  bool isInvoke = false;

  //套装属性
  List<SuitFunction> suitFunctions = [];

  Suit(this.name, this.invokeCount);

  List<PassiveEffect> invoke() {
    isInvoke = true;
    for (var e in suitFunctions) {
      e.isInvoke = true;
    }
    return _effects();
  }

  List<PassiveEffect> notInvoke() {
    isInvoke = false;
    for (var e in suitFunctions) {
      e.isInvoke = false;
    }
    return _effects();
  }

  ///套装的被动效果
  List<PassiveEffect> _effects() {
    if (name == 'suit001'.suitName()) {
      return [PassiveEffect('effect001'.effectName())];
    } else if (name == 'suit002'.suitName()) {
      return [PassiveEffect('effect002'.effectName())];
    } else {
      return [];
    }
  }
}
